/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * <p>Project: javaseapp - D
 * <p>Powered by webrx On 2021-09-04 09:46:41
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class D {
    public static void main(String[] args) {
        record Book(String name, String author, double price) {
        }
        var list = new ArrayList<Book>();
        list.add(new Book("《java项目开发》", "James Gosling", 30));
        list.add(new Book("《php项目开发》", "James Gosling", 30));
        list.add(new Book("《python项目开发》", "James Gosling", 30));
        list.add(new Book("《javascript》", "James Gosling", 30));
        list.add(new Book("《html》", "James Gosling", 30));

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入书籍名称：");
        String name = sc.nextLine();
        //list.stream().filter(e -> e.name().equals(name)).forEach(System.out::println);
        list.stream().filter(e -> e.name().contains(name)).forEach(System.out::println);

    }
}
